from typing import List


class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        num_dict = {}

        for index in range(len(nums)):
            cur_num = nums[index]
            des = target - cur_num
            if des in num_dict:
                return [num_dict[des], index]
            num_dict[cur_num] = index
        return []

print(Solution().twoSum(nums=[2, 7, 11, 15], target=9))
